package com.zikao.question.service.impl;

import com.zikao.question.entity.QuestionEntity;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zikao.common.utils.PageUtils;
import com.zikao.common.utils.Query;

import com.zikao.question.dao.Collect2Dao;
import com.zikao.question.entity.Collect2Entity;
import com.zikao.question.service.Collect2Service;


@Service("collect2Service")
public class Collect2ServiceImpl extends ServiceImpl<Collect2Dao, Collect2Entity> implements Collect2Service {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<Collect2Entity> page = this.page(
                new Query<Collect2Entity>().getPage(params),
                new QueryWrapper<Collect2Entity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<Collect2Entity> selectByMap(Map<String, Object> params) {
        return baseMapper.selectByMap(params);
    }

    @Override
    public PageUtils queryPage(Map<String, Object> params, QueryWrapper<Collect2Entity> queryWrapper) {
        IPage<Collect2Entity> page = this.page(
                new Query<Collect2Entity>().getPage(params),
                queryWrapper
        );
        return new PageUtils(page);
    }
}